<?php
namespace Common\Model;
use Think\Model;
class UserGuiderModel extends UserModel {
    /**
     * model的中文名称
     */
    public $modelName = '导游';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-star';
    
    protected $_auto = [
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["principal_id", "require", "用户ID必须填写!"],
        ["gender", "require", "性别必须填写!"],
        ["guider_type", "require", "导游类型必须填写!"],
        ["nationality", "require", "国籍必须填写!"],
        ["degree", "require", "学历必须填写!"],
        ["college", "require", "毕业院校必须填写!"],
        ["star", "require", "星级必须填写!"],
        ["price", "require", "价格必须填写!"],
        ["special", "require", "特长必须填写!"],
        ["justification", "require", "执照必须填写!"],
        ["detail", "require", "详情必须填写!"],
        ["h5_link", "require", "H5简介链接必须填写!"],
        ["create_time", "require", "创建时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];
    public $excel = false;
    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "list"=>true,
            "search"=>true,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "principal_id"=>[
            "type"=>"input",
            "name"=>"用户名",
            "list"=>true,
            "search"=>true,
            "input"=>'create',
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center"><a href="{:U(\'user/list\')}?searchMap[id]={$vo[principal_id]}"><php>echo D(\'User\')->find($vo[principal_id])[\'username\'];</php></a></td>',
        ],
        "gender"=>[
            "type"=>"select",
            "name"=>"性别",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"男,女",
            "list_specify"=>"",
        ],
        "guider_type"=>[
            "type"=>"select",
            "name"=>"导游类型",
            "list"=>true,
            "search"=>true,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"大学生导游,社会导游,职业导游,国外导游",
            "list_specify"=>"",
        ],
        "nationality"=>[
            "type"=>"input",
            "name"=>"国籍",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "degree"=>[
            "type"=>"input",
            "name"=>"学历",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "college"=>[
            "type"=>"input",
            "name"=>"毕业院校",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "star"=>[
            "type"=>"select",
            "name"=>"星级",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"1,2,3,4,5",
            "list_specify"=>"",
        ],
        "age"=>[
            "type"=>"input",
            "name"=>"年龄",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],

        "price"=>[
            "type"=>"input",
            "name"=>"价格",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "special"=>[
            "type"=>"textarea",
            "name"=>"特长",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "img"=>[
            "type"=>"file",
            "name"=>"大图",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>false,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center"><img src="__PUBLIC__/file/{$vo[photo]}" width="50" height="50"/></td>',
        ],
        "justification"=>[
            "type"=>"file",
            "name"=>"执照",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>false,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center"><img src="__PUBLIC__/file/{$vo[justification]}" width="50" height="50"/></td>',
        ],
        "detail"=>[
            "type"=>"ueditor",
            "name"=>"详情",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "h5_link"=>[
            "type"=>"input",
            "name"=>"H5简介",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"创建时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
        ],
    ];
}
